﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Øving3Blackjack
{
    class Points
    {
        private Point[][] playerPoints = new Point[11][];
        private Point[][] dealerPoints = new Point[11][];
        private Point[][] splitPointsLeft = new Point[11][];
        private Point[][] splitPointsRight = new Point[11][];
       
        public Points()
        {
            playerPoints[0] = new Point[2] { new Point(360, 250), new Point(390, 250) };
            playerPoints[1] = new Point[3] { new Point(345, 250), new Point(375, 250), new Point(405, 250) };
            playerPoints[2] = new Point[4] { new Point(330, 250), new Point(360, 250), new Point(390, 250), new Point(420, 250) };
            playerPoints[3] = new Point[5] { new Point(315, 250), new Point(345, 250), new Point(375, 250), new Point(405, 250), new Point(435, 250) };
            playerPoints[4] = new Point[6] { new Point(300, 250), new Point(330, 250), new Point(360, 250), new Point(390, 250), new Point(420, 250), new Point(450, 250) };
            playerPoints[5] = new Point[7] { new Point(285, 250), new Point(315, 250), new Point(345, 250), new Point(375, 250), new Point(405, 250), new Point(435, 250), new Point(465, 250) };
            playerPoints[6] = new Point[8] { new Point(270, 250), new Point(300, 250), new Point(330, 250), new Point(360, 250), new Point(390, 250), new Point(420, 250), new Point(450, 250), new Point(480, 250) };
            playerPoints[7] = new Point[9] { new Point(255, 250), new Point(285, 250), new Point(315, 250), new Point(345, 250), new Point(375, 250), new Point(405, 250), new Point(435, 250), new Point(465, 250), new Point(495, 250) };
            playerPoints[8] = new Point[10] { new Point(240, 250), new Point(270, 250), new Point(300, 250), new Point(330, 250), new Point(360, 250), new Point(390, 250), new Point(420, 250), new Point(450, 250), new Point(480, 250), new Point(510, 250) };
            playerPoints[9] = new Point[11] { new Point(225, 250), new Point(255, 250), new Point(285, 250), new Point(315, 250), new Point(345, 250), new Point(375, 250), new Point(405, 250), new Point(435, 250), new Point(465, 250), new Point(495, 250), new Point(525, 250) };
            
            dealerPoints[0] = new Point[2] { new Point(340, 0), new Point(410, 0) };
            dealerPoints[1] = new Point[3] { new Point(305, 0), new Point(375, 0), new Point(445, 0) };
            dealerPoints[2] = new Point[4] { new Point(270, 0), new Point(340, 0), new Point(410, 0), new Point(480, 0) };
            dealerPoints[3] = new Point[5] { new Point(235, 0), new Point(305, 0), new Point(375, 0), new Point(445, 0), new Point(515, 0) };
            dealerPoints[4] = new Point[6] { new Point(200, 0), new Point(270, 0), new Point(340, 0), new Point(410, 0), new Point(480, 0), new Point(550, 0) };
            dealerPoints[5] = new Point[7] { new Point(165, 0), new Point(235, 0), new Point(305, 0), new Point(375, 0), new Point(445, 0), new Point(515, 0), new Point(585, 0) };
            dealerPoints[6] = new Point[8] { new Point(130, 0), new Point(200, 0), new Point(270, 0), new Point(340, 0), new Point(410, 0), new Point(480, 0), new Point(550, 0), new Point(620, 0) };
            dealerPoints[7] = new Point[9] { new Point(95, 0), new Point(165, 0), new Point(235, 0), new Point(305, 0), new Point(375, 0), new Point(445, 0), new Point(515, 0), new Point(585, 0), new Point(655, 0) };
            dealerPoints[8] = new Point[10] { new Point(60, 0), new Point(130, 0), new Point(200, 0), new Point(270, 0), new Point(340, 0), new Point(410, 0), new Point(480, 0), new Point(550, 0), new Point(620, 0), new Point(690, 0) };
            dealerPoints[9] = new Point[11] { new Point(25, 0), new Point(95, 0), new Point(165, 0), new Point(235, 0), new Point(305, 0), new Point(375, 0), new Point(445, 0), new Point(515, 0), new Point(585, 0), new Point(655, 0), new Point(725, 0) };

            splitPointsLeft[0] = new Point[2] { new Point(185, 250), new Point(215, 250) };
            splitPointsLeft[1] = new Point[3] { new Point(170, 250), new Point(200, 250), new Point(230, 250) };
            splitPointsLeft[2] = new Point[4] { new Point(155, 250), new Point(185, 250), new Point(215, 250), new Point(245, 250) };
            splitPointsLeft[3] = new Point[5] { new Point(140, 250), new Point(170, 250), new Point(200, 250), new Point(230, 250), new Point(260, 250) };
            splitPointsLeft[4] = new Point[6] { new Point(125, 250), new Point(155, 250), new Point(185, 250), new Point(215, 250), new Point(245, 250), new Point(275, 250) };
            splitPointsLeft[5] = new Point[7] { new Point(110, 250), new Point(140, 250), new Point(170, 250), new Point(200, 250), new Point(230, 250), new Point(260, 250), new Point(290, 250) };
            splitPointsLeft[6] = new Point[8] { new Point(95, 250), new Point(125, 250), new Point(155, 250), new Point(185, 250), new Point(215, 250), new Point(245, 250), new Point(275, 250), new Point(305, 250) };
            splitPointsLeft[7] = new Point[9] { new Point(80, 250), new Point(110, 250), new Point(140, 250), new Point(170, 250), new Point(200, 250), new Point(230, 250), new Point(260, 250), new Point(290, 250), new Point(320, 250) };
            splitPointsLeft[8] = new Point[10] { new Point(65, 250), new Point(95, 250), new Point(125, 250), new Point(155, 250), new Point(185, 250), new Point(215, 250), new Point(245, 250), new Point(275, 250), new Point(305, 250), new Point(335, 250) };
            splitPointsLeft[9] = new Point[11] { new Point(50, 250), new Point(80, 250), new Point(110, 250), new Point(140, 250), new Point(170, 250), new Point(200, 250), new Point(230, 250), new Point(260, 250), new Point(290, 250), new Point(320, 250), new Point(350, 250) };

            splitPointsRight[0] = new Point[2] { new Point(545, 250), new Point(575, 250) };
            splitPointsRight[1] = new Point[3] { new Point(530, 250), new Point(560, 250), new Point(590, 250) };
            splitPointsRight[2] = new Point[4] { new Point(515, 250), new Point(545, 250), new Point(575, 250), new Point(605, 250) };
            splitPointsRight[3] = new Point[5] { new Point(500, 250), new Point(530, 250), new Point(560, 250), new Point(590, 250), new Point(620, 250) };
            splitPointsRight[4] = new Point[6] { new Point(485, 250), new Point(515, 250), new Point(545, 250), new Point(575, 250), new Point(605, 250), new Point(635, 250) };
            splitPointsRight[5] = new Point[7] { new Point(470, 250), new Point(500, 250), new Point(530, 250), new Point(560, 250), new Point(590, 250), new Point(620, 250), new Point(650, 250) };
            splitPointsRight[6] = new Point[8] { new Point(455, 250), new Point(485, 250), new Point(515, 250), new Point(545, 250), new Point(575, 250), new Point(605, 250), new Point(635, 250), new Point(665, 250) };
            splitPointsRight[7] = new Point[9] { new Point(440, 250), new Point(470, 250), new Point(500, 250), new Point(530, 250), new Point(560, 250), new Point(590, 250), new Point(620, 250), new Point(650, 250), new Point(680, 250) };
            splitPointsRight[8] = new Point[10] { new Point(425, 250), new Point(455, 250), new Point(485, 250), new Point(515, 250), new Point(545, 250), new Point(575, 250), new Point(605, 250), new Point(635, 250), new Point(665, 250), new Point(695, 250) };
            splitPointsRight[9] = new Point[11] { new Point(410, 250), new Point(440, 250), new Point(470, 250), new Point(500, 250), new Point(530, 250), new Point(560, 250), new Point(590, 250), new Point(620, 250), new Point(650, 250), new Point(680, 250), new Point(710, 250) };
        
        }

        public Point getPoint(Boolean player, int split, int amtCards, int card)
        {
            if (player)
            {
                if (split == 0)
                {
                    return playerPoints[amtCards - 2][card - 1];
                }
                else if (split == 1)
                {
                    return splitPointsLeft[amtCards -2][card - 1];
                }
                else 
                {
                    return splitPointsRight[amtCards -2][card - 1];
                }
            }
            else
            {
                return dealerPoints[amtCards - 2][card - 1];
            }
        }
    }
}
